Support configuring nomad/consul/ebi versions#2868
Conversation
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 892346d. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Code Review
This pull request parameterizes the source AMI filter name and Packer build variables, and updates the Consul and Nomad installation scripts to use the unzip -n flag. However, using -n prevents overwriting existing binaries in /tmp, which could silently result in outdated or incorrect versions being installed; it is recommended to use the -o flag instead to force overwriting.
❌ 3 Tests Failed:
View the full list of 3 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d227a32. Configure here.
7345499 to
892346d
Compare
There was a problem hiding this comment.
LGTM — build-tooling plumbing only; defaults preserve current behavior and prior bot feedback (empty-var override, AWS/GCP var name mix-up, source_name typo) is fixed in the latest commits.
Extended reasoning...
Overview
This PR makes the Nomad cluster disk image build configurable via env vars. It touches: install scripts (install-consul.sh, install-nomad.sh) to add unzip -o for idempotent extraction; AWS and GCP Packer Makefiles to conditionally forward PACKER_CONSUL_VERSION, PACKER_NOMAD_VERSION, network/subnet identifiers, and a base-image override; and the corresponding variables.pkr.hcl / main.pkr.hcl files to introduce source_ami_filter_name (AWS) and source_image (GCP) variables wired to the existing hardcoded defaults.
Security risks
None meaningful. All changes are scoped to image-build tooling that runs at build time (not at runtime in the sandbox or control plane). No auth, crypto, network policy, or permission code is touched. The new variables only influence which OS base image is used and which Consul/Nomad versions get installed.
Level of scrutiny
Low. This is mechanical configuration plumbing for image builds. The $(if $(VAR),...) Makefile pattern ensures empty overrides are not passed to Packer, so existing defaults in the HCL files continue to apply when the new env vars are unset — i.e., the change is backward compatible by construction.
Other factors
Earlier commits drew several bot findings from Cursor and Gemini (empty env vars overriding Packer defaults, AWS Makefile inheriting GCP variable names, an incorrect source_name vs source_image mismatch, and a unzip -n instead of -o). The latest commits in the branch ("Unify packer envs vars naming", "fix env var", "oops, this is the right flag", "go back to the old vars") address each of these — the current diff uses vpc_id/subnet_id for AWS, source_image for GCP, conditional var passing, and unzip -o. No bugs were surfaced by the bug-hunting system for the current commit, and there are no unresolved human review threads.

Support for customizing Nomad/Consul and source image versions.